<link rel="stylesheet" href="__CDN__/assets/kindeditor/themes/default/default.css" />
<script src="__CDN__/assets/kindeditor/kindeditor.js"></script>
<script src="__CDN__/assets/kindeditor/lang/zh_CN.js"></script>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">标题:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" name="title" class="form-control" />
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">文章内容:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea style="width:100%;height:400px" name="auto_content"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">是否设为推送:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox">
                <label class="checkbox-inline">
                    <input type="checkbox" name="is_push" value="1"> 推送
                </label>
            </div>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">提交</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    var editor;
    KindEditor.ready(function(K) {
        editor = K.create('textarea[name="auto_content"]', {
            allowFileManager : true,
            resizeType:0,
            //autoHeightMode : true,
            afterCreate : function() {
                this.sync();
                this.loadPlugin('autoheight');
            },
            afterChange: function(){ //编辑器内容发生变化后，将编辑器的内容设置到原来的textarea控件里
                this.sync();
            },
            afterBlur : function(){ //编辑器聚焦后，将编辑器的内容设置到原来的textarea控件里
                this.sync();
            }
        });
    });
</script>
